
package ConversorBase;


public class ConversorDecimal {
    
private String numBin;
private String numHex;
private String numOct;
private int numDec;
    
    public ConversorDecimal(){}
    
    
    
    public int converteBinario(){
    numDec = Integer.parseInt(numBin, 2);
    return numDec;

}
    
    public int converteOctal(){
        numDec = Integer.parseInt(numOct, 8);
        return numDec;
    }
    
    public int converteHexadecimal(){
        numDec = Integer.parseInt(numHex, 16);
        return numDec;
    }
    
    /**
     * @return the numBin
     */
    public String getNumBin() {
        return numBin;
    }

    /**
     * @param numBin the numBin to set
     */
    public void setNumBin(String numBin) {
        this.numBin = numBin;
    }

    /**
     * @return the numHex
     */
    public String getNumHex() {
        return numHex;
    }

    /**
     * @param numHex the numHex to set
     */
    public void setNumHex(String numHex) {
        this.numHex = numHex;
    }

    /**
     * @return the numOct
     */
    public String getNumOct() {
        return numOct;
    }

    /**
     * @param numOct the numOct to set
     */
    public void setNumOct(String numOct) {
        this.numOct = numOct;
    }

    /**
     * @return the valorDec
     */
    public int getNumDec() {
        return numDec;
    }

    /**
     * @param valorDec the valorDec to set
     */
    public void setNumDec(int numDec) {
        this.numDec = numDec;
    }
}
